package com.springcloud.config.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
//curl -X POST "http://localhost:3355/actuator/refresh"
public class ConfigController {

    @Value("${config.info}")
    private String configInfo;

    @Value("${server.port}")
    private String servicePort;

    @RequestMapping("/configInfo")
    public String getConfigInfo() {
        return "servicePort:" + servicePort + "\t\t" + "configInfo:" + configInfo;
    }
}
